package com.nbsaas.boot.store.rest.convert;

import com.nbsaas.boot.store.data.entity.StoreCatalog;
import com.nbsaas.boot.store.api.domain.response.StoreCatalogResponse;

import com.nbsaas.boot.utils.BeanDataUtils;
import com.nbsaas.boot.rest.api.Converter;
/**
* 实体对象转化成响应对象
*/

public class StoreCatalogResponseConvert  implements Converter<StoreCatalogResponse,StoreCatalog> {

    @Override
    public StoreCatalogResponse convert(StoreCatalog source) {
        StoreCatalogResponse  result = new  StoreCatalogResponse();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getParent()!=null){
                        result.setParent(source.getParent().getId());
                    }
        return result;
    }

}

